<template>
		<Layout class="p-5 bg-white">
			<Form  class="p-5" :model="cutDepositRecord" :label-width="130">
				
					<Col span="8">
						<FormItem class="w-100" label="扣押记录编号">
							<label>: {{this.param.cutId}}</label>
						</FormItem>
						<FormItem class="w-100" label="客户名称">
							<label>: {{this.clientName}}</label>
						</FormItem>
						<FormItem class="w-100" label="创建时间">
							<label>: {{this.ct}}</label>
						</FormItem>
						<FormItem class="w-100" label="金额">
							<label>: {{this.amount}}</label>
						</FormItem>
						<FormItem class="w-100" label="门店">
							<label>: {{this.name}}</label>
						</FormItem>
						<FormItem class="w-100" label="扣押状态">
							<label>
								<span v-if="param.ioFlg=='true'">取消扣押</span>
								<span v-if="param.ioFlg=='false'">扣押</span>
							</label>
							
						</FormItem>
						<FormItem class="w-100" label="原因">
							<label>: {{this.param.reason}}</label>
						</FormItem>
						<FormItem>
						    <Button @click="cancel" style="margin-left: 1px">取消</Button>
						</FormItem>
				</Col>
				
			</Form>
		</Layout>
</template>

<script>
	export default {
		data() {
			return {
				param: {
					cutId: "",
					ioFlg: "",
					ct: "",
					amount: "",
					reason: ""
				},
				clientName: "",
				ct: "",
				amount: "",
				name: "",
			}
		},
		methods: {
			getCut: function() {
				this.http.get({ 
					url: "/client/deposit-record/cut/info",
					param: {
						cutId:this.$data.param.cutId,
					}
				}).then(data => {
					data.cut_deposit_record.ct = data.cut_deposit_record.ct.replace('T',' ');
					
					this.$data.param.cutId = data.cut_deposit_record.cutId;
					this.$data.clientName = data.client.clientName;
					this.$data.ct = data.cut_deposit_record.ct;
					this.$data.amount = data.cut_deposit_record.amount/100;
					this.$data.name = data.store.name;
					this.$data.param.ioFlg = data.cut_deposit_record.ioFlg;
					this.$data.param.reason = data.cut_deposit_record.reason;
					if(this.$data.param.ioFlg){
						this.$data.param.ioFlg = 'true';
					}else{		
						this.$data.param.ioFlg = 'false';
						
					}
				});
			},
			cancel: function() {
				// 取消
				this.$router.push({ name: "cutDepositRecord_detail" , params: { cutId: this.$data.param.cutId }});
				this.$tabs.close();
			}
		},
		created(){
			this.$data.param.cutId = this.$route.params.cutId;
			this.getCut();
		}
	}
</script>

<style>
</style>
